Applied AI in Banking and Finance
Case 1: Financial Index Analysis
Review of AIEQ Case
Hang Seng Index
Case 2: Financial Anomoly Detection
Outlier Peeling Algorithm
class: center, middle
In this lecture, we discuss two FinTech case studies with the equipped DataViz skills:
Case 1: Financial Index Analysis
Review of AIEQ Case
Hang Seng Index
Case 2: Finanial Anomoly Detection
Outlier Peeling Algorithm
Radial Chart Visualization
Active investing
The market is not perfectly efficient
Aims to beat the market and take advantage of short-term price fluctuations
Passive investing
The market is efficient in the long run
Buy-and-hold philosophy
Index tracking strategy, e.g. ETF
X.Shares <- X.Weight * HSI.Close * HSI.Divisor / X.Close
Data Preprocessing to convert data into space-time format
DataX = read.csv("DataHSI.csv")
DataX$Date2 = as.factor(DataX$Date)
tmp = DataX[!duplicated(DataX$Ticker, fromLast = T),]
idx = order(tmp$Date, tmp$Weight, decreasing = T)
ListTicker=tmp$Ticker[idx]
n = length(ListTicker)
ListDate = as.character(unique(DataX$Date))
MatWeight <- MatShares <- matrix(NA, length(ListDate), n)
for (j in 1:n){
TmpX = DataX[DataX$Ticker==ListTicker[j], c("Date2", "Weight", "Shares")]
MatWeight[as.numeric(TmpX$Date2),j] = TmpX$Weight
MatShares[as.numeric(TmpX$Date2),j] = TmpX$Shares
}
colnames(MatWeight) <- colnames(MatShares) <- ListTicker
MatWeight = xts(MatWeight, order.by=as.Date(ListDate, "%Y%m%d"))
MatShares = xts(MatShares, order.by=as.Date(ListDate, "%Y%m%d"))div(dygraph(MatWeight, main = "HSI Constituent Weights",height=450) %>%
dyRangeSelector(dateWindow = c("2016-01-01", "2018-12-31")) %>%
dyLegend(show = "never"), align="center")TmpX = MatShares[,1:4]; TmpX = TmpX/rep(1, dim(TmpX)[1])%*%t(colMeans(TmpX, na.rm=T))
div(dygraph(TmpX, main = "HSI Constituent Shares", ylab="Normalized shares",height=450) %>%
dyRangeSelector(dateWindow = c("2016-01-01", "2018-12-31")) %>%
dyOptions(colors = c("red", "blue", "green", "cyan"), strokeWidth=2), align="center")class: center, middle
class: center, middle
Q&A or Email ajzhang@hku.hk。